import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
      redirect: '/traffic-indicators',
      children: [
        {
          path: 'traffic-indicators',
          name: 'trafficIndicators',
          component: () => import('../views/traffic/TrafficIndicators.vue')
        },
        {
          path: 'traffic-jam',
          name: 'trafficJam',
          component: () => import('../views/trafficjam/TrafficJam.vue')
        },
        {
          path: 'weather',
          name: 'weather',
          component: () => import('../views/weather/Weather.vue')
        },
        {
          path: 'travel-advice',
          name: 'travelAdvice',
          component: () => import('../views/travel-advice/TravelAdvice.vue')
        }
      ]
    }
  ]
})

export default router
